/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 0
 * Date: 2023-04-26
 * Time: 20:21
 */
public class Test {


        /*System.out.println("输入一个整数：");
        int a = scan.nextInt();
        System.out.println(a);
        scan.nextLine();//回车给消掉
        System.out.println("输入你的姓名：");
        String name = scan.nextLine();//遇到空格不会结束的
        System.out.println(name);
        System.out.println("输入一个小数：");
        double d = scan.nextDouble();
        System.out.println(d);*/


        public static void main8(String[] args) {
            System.out.println("输出且换行");
            System.out.print("输出不换行");
            System.out.printf("%s\n","格式化输出！");
        }
        public static void main7(String[] args) {
            int x = 0;
            do {
                System.out.println(x);
            }while (x != 0);
        }
        public static void main6(String[] args) {
            int sum = 0;
            for (int x = 1; x <= 5; x++) {
                int ret = 1;
                for (int i = 1; i <= x; i++) {
                    ret *= i;
                }
                //System.out.println(ret);
                sum += ret;
            }
            System.out.println(sum);
        }
        public static void main5(String[] args) {
       /* int a = 1;
        while (a <= 2) {
            while (a <= 5) {
                a++;
            }
        }
        a--;
        System.out.println(a);*/
        /*while (true) {
            System.out.println("fsdfsa");
        }*/
       /* int i = 1;
        while (i <= 10) {
            if(i % 3 == 0) {
                System.out.println(i);
                i++;
                continue;
            }
            i++;
        }*/
            int i = 1;
            while (i <= 100) {
                if(i % 30 != 0) {
                    i++;
                    continue;
                }
                System.out.println(i);
                i++;
            }
        }
        public static void main4(String[] args) {
            int x = 1;
            int sum = 0;
            while (x < 16) {
                int i = 1;
                int ret = 1;
                while (i <= x) {
                    ret = i * ret;
                    i++;
                }
                //System.out.println(ret);
                sum += ret;
                x++;
            }
            System.out.println(sum);
        }
        public static void main3(String[] args) {
       /* int a = 10;
        switch (a > 10) {
            case 1:
                break;
        }
        int i = 1;
        while ( i <= 10 ) {
            System.out.println(i);
            i++;
        }*/
            int i = 1;
            int sum = 0;
            while (i <= 100) {
                sum = sum + i;
                i++;
            }
            System.out.println("sum = "+sum);

            i = 1;
            int sumOdd = 0;
            while (i <= 100) {
                sumOdd = sumOdd + i;
                i += 2;
            }
            System.out.println("sumOdd = "+sumOdd);

            i = 2;
            int sumEve = 0;
            while (i <= 100) {
                sumEve = sumEve + i;
                i += 2;
            }
            System.out.println("sumEve = "+sumEve);



        }
        //面试问题：不能做switch的参数的数据类型是哪些？ long  float  double  boolean
        public static void main2(String[] args) {
            String a = "hello";
            switch (a) {
                case "hello":
                    System.out.println(2);
                    break;
                case "hello1":
                    System.out.println(1);
                    break;
                default:
                    System.out.println("fsfsadsaf");
                    break;
            }
        }
        public static void main1(String[] args) {
            System.out.println("\\\"hello\\\"");
            //System.out.println("\\"  hello \\"");
            // System.out.println(hello);
            //System.out.println("\\hello\\");

        /*short a = 128;//0000 0000 1000 0000

        byte b = (byte) a;//-128   1000 0000
        System.out.println(b);

        int a = 10;
        System.out.println(!a);*/


        }
}
